const cookieFn = () => {
  const loginObj = {}
  const cookie = document.cookie
  const cookieArr = cookie.split('; ')
  const valueList = cookieArr.map(item => {
    const resultArr = item.split('=')

    return resultArr
  })
  const isLoginrst = valueList.filter(item => {
    return item.includes('isLogin')
  })
  if (isLoginrst.length !== 0) {
    loginObj[isLoginrst[0][0]] = isLoginrst[0][1]
  }
  if (loginObj.isLogin) {
    return true
  } else {
    return false
  }
}

export { cookieFn }
